home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / windows / wbt31a.zip / PLAYMIDI.WB$ < prev    next >
Text File  |  1991-12-25  |  1KB  |  32 lines

  1. IntControl(12,1,0,0,0)            ; Allow Batch file to be terminated
  2.  
  3. ; Get default directory from INI file.  If none, use the Windows Dir
  4. MidiDir1=inireadpvt("Batch","MidiDir",DirWindows(0),"WWW-PROD.INI")
  5.  
  6. ; Confirm user for Directory of MIDI files to play
  7. MidiDir2=AskLine("MIDI Player","Enter directory of MIDI files",MidiDir1)
  8.  
  9. ; Gee, if user specified a different dir, remember the new one
  10. if MidiDir1!=MidiDir2 then iniWritePvt("Batch","MidiDir",MidiDir2)
  11.  
  12. ; Change to the MIDI file directory
  13. DirChange("MidiDir2")
  14.  
  15. ; Get a list of all the *.MID and *.RMI files in the directory
  16. files=FileItemize("*.MID *.RMI")
  17.  
  18. ; How many files are in there
  19. count=ItemCount(files," ")
  20.  
  21.  
  22. :again         ; AGAIN is used to play ALL the files again
  23. index=0        ; set current file index to zero
  24.  
  25. :loop          ; LOOP through each file in the directory
  26. index=index+1                      ; Increment file index
  27. if index>count then goto again     ; If bigger then number of files -> AGAIN
  28. play=ItemExtract(index,files," ")  ; Extract desired filename from list
  29. WinTitle("",play)                  ; Change icon title to file name
  30. PlayMidi(play,0)                   ; Play Midi file.  Wait for completion
  31. goto loop                          ; Go play the next MIDI file
  32.